/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : 
  * @brief          : 
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __ELECTRONICBRAKE_H
#define __ELECTRONICBRAKE_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g4xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
typedef enum
{
    B_LOCK = 0x00,
    B_UNLOCK = 0x01,
    B_UNLOCKing = 0x02,
    B_LOCKing = 0x03,
    B_LOCKOVERCURRENT = 0xfa,
    B_OVERCURRENT = 0xfb,
    B_UNDERCURRNET = 0xfc,
    B_LOGICERROR = 0xfd
} _BrakeState;
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */


/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
/* USER CODE BEGIN EFP */
void Brake_Control(char on_off);
void Brake_Routine(uint16_t freq);
char BrakeState_Get(void);
uint8_t Call_BrakeState_Read(void);
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif 
